

package io.lumine.xikage.mythicmobs.util;

import io.lumine.xikage.mythicmobs.skills.projectiles.Projectile.ProjectileTracker;
import org.bukkit.Material;
import org.bukkit.block.Block;


import java.util.HashSet;

public class BlockUtil {
    private static final HashSet<Material> PATHABLE = new HashSet();
    private static final HashSet<Material> MAYBE_PATHABLE = new HashSet();
    private static final HashSet<Material> BREATHABLE = new HashSet();

    public BlockUtil() {
    }

    public static boolean isPathable(Block block) {
        return isPathable(block.getType());
    }

    public static boolean isPathable(Block block, ProjectileTracker projectile) {
        return isBreathable(block);
    }

    public static boolean isPathable(Material material) {
        return PATHABLE.contains(material);
    }

    public static boolean isBreathable(Block block) {
        return isBreathable(block.getType());
    }

    public static boolean isBreathable(Material material) {
        return !material.isSolid() && material != Material.WATER && material != Material.LAVA;
    }

    static {
        Material[] var0 = Material.values();
        int var1 = var0.length;

        for (Material material : var0) {
            if (!material.toString().equals("GRASS_PATH") && !material.toString().equals("DIRT_PATH")) {
                if (!material.isOccluding()) {
                    PATHABLE.add(material);
                    MAYBE_PATHABLE.add(material);
                } else if (material.toString().contains("SLAB")) {
                    PATHABLE.add(material);
                    MAYBE_PATHABLE.add(material);
                }
            }
        }

    }
}
